import { createApp } from "vue";
import ElementPlus from "element-plus";
import "element-plus/dist/index.css";
import "./style/index.less";
import App from "./App.vue";
import zhCn from "element-plus/es/locale/lang/zh-cn";
import * as ElementPlusIconsVue from "@element-plus/icons-vue";
import { setupRouter } from "./router";
import { setupStore } from "./store";
import "virtual:svg-icons-register";
import { setDomFontSize } from "@/utils/rem";

const bootstrap = () => {
  setDomFontSize();
  const app = createApp(App);
  app.use(ElementPlus, {
    locale: zhCn,
  });
  setupRouter(app);
  setupStore(app);
  for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component);
  }
  app.mount("#app");
};

bootstrap();
